load "Logger.rb"
load "TokenType.rb"
load "Tree.rb"
load "Parser.rb"

Logger.debugMode = false 

ARGV.each  do |expression|
    parser = Parser.new(expression)
    tree = parser.createTree
     puts "-"
    if(tree.isOk())
        Logger.debug(tree.getLatex)
        puts "Infix: #{tree.getInfix}"
        puts "Prefix: #{tree.getPrefix}"
        puts "Postfix: #{tree.getPostfix}"
        puts "Value of expression: #{tree.eval}"
    else
        puts "Error in tree for expression: #{expression}"
    end
end
